import java.util.*;

/**
 * @author LKQ
 * @date 2022/6/13 22:17
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextLine()) {
            String t = sc.nextLine();
            int[] cnt = new int[4];
            for (char c: t.toCharArray()) {
                if (Character.isLetter(c)) {
                    cnt[0]++;
                }else if (Character.isDigit(c)) {
                    cnt[2]++;
                }else if (c == ' ') {
                    cnt[1]++;
                }else {
                    cnt[3]++;
                }
            }
            for (int i = 0; i < 4; i++) {
                System.out.println(cnt[i]);
            }
        }
    }
}
